package split.comm.app;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageButton;
import android.widget.TextView;
import android.widget.Toast;

public class SplitComm extends Activity
{
	
	public Card oMainTree;
	public Card oCurrentCard;
	ImageButton bLBtn;
	ImageButton bRBtn;
	TextView tLBtn;
	TextView tRBtn;
	
	/** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    	//Define both buttons
        bLBtn = (ImageButton)findViewById(R.id.bLeftButton);
    	bRBtn = (ImageButton)findViewById(R.id.bRightButton);
    	tLBtn = (TextView)findViewById(R.id.tLeftText);
    	tRBtn = (TextView)findViewById(R.id.tRightText);
        //Define tree of cards
        oMainTree = new Card(new Card(new Card(null, null, "LeftSubL"), new Card(null, null, "RightSubL"), "Left"), new Card(null, null, "Right"), "Main");
        oCurrentCard = oMainTree;
        tLBtn.setText(oCurrentCard.oLeftCard.sName);
        tRBtn.setText(oCurrentCard.oRightCard.sName);
    	//Define left button procedures
    	bLBtn.setOnClickListener(new OnClickListener()
    	{
    	     public void onClick(View v)
    	     {
    	    	 LeftClick();
    	     }
	    }
    	);    	
    	//Define right button procedures
    	bRBtn.setOnClickListener(new OnClickListener()
    	{
    	     public void onClick(View v)
    	     {
    	    	 RightClick();
    	     }
	    }
    	);
    }
    
    public void LeftClick()
    {
    	Toast.makeText(getApplicationContext(), "Left Button", Toast.LENGTH_LONG).show();
    }
    
    public void RightClick()
    {
    	Toast.makeText(getApplicationContext(), "Right Button", Toast.LENGTH_LONG).show();
    }

}